package com.lovvyang.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author lovvyang
 * @date 2020/6/10-21:46
 */
/*
 * @PackageName:com.lovvyang.servlet
 * @ClassName:ResponseDemo01
 * @Description
 * @author lovvyang
 * @date 2020/6/10/21:46
 **/
@WebServlet("/responseDemo02")
public class ResponseDemo02 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("text/html;charset=utf-8");
        System.out.println("demo2");
        resp.getWriter().write("<h1>重定向成功!!!!</h1>");

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doGet(req,resp);
    }
}
